﻿using System;
using System.Linq;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;

namespace Babushka.Resources
{
    static class Graphics
    {
        public static Texture2D[] Babushkas { get; set; }
        public static Texture2D Floor { get; set; }
        public static Texture2D Tiles { get; set; }
        public static Texture2D Target { get; set; }
        public static void InitGraphics(ContentManager content)
        {
            Babushkas = new Texture2D[5];
            for (int i = 0; i < Babushkas.Length; i++)
            {
                Babushkas[i] = content.Load<Texture2D>(string.Format("b{0}", i + 1));
            }
            Floor = content.Load<Texture2D>("floor");
            Tiles = content.Load<Texture2D>("tiles");
            Target = content.Load<Texture2D>("t");
        }

        /*DO NOT USE THIS METHOD !!!*/
        private /*public*/ static void DestroyGraphics()
        {
            for (int i = 0; i < Babushkas.Length; i++)
            {
                Babushkas[i].Dispose();
            }
            Floor.Dispose();
        }
    }
}